<?php
class Opened_doorsModule extends fvModule {

	function __construct () {
	    $moduleName = strtolower(substr(__CLASS__, 0, -6));
	    parent::__construct(fvSite::$fvConfig->get("modules.{$moduleName}.smarty.template"), 
	                        fvSite::$fvConfig->get("modules.{$moduleName}.smarty.compile"), 
	                        fvSite::$Layoult);
	}
	
	function showIndex($params) {
		$pager = new fvPager(PresscenterManager::getInstance());
	    $this->__assign(array('Presscenter' => $pager->paginate(
	    "type='openeddoors' and lang='".fvSite::$fvSession->get("lang")."'", "create_date DESC") , 
	    "sp" => StaticPagesManager::getInstance()->getAll("tech_url='opened_doors' and lang='".fvSite::$fvSession->get("lang")."'")));
        return $this->__display("openeddoors_index.tpl");
	}
	
	function showOne($params) {
	    $request = fvRequest::getInstance();
        if (!$Presscenter = PresscenterManager::getInstance()->getByPk($request->getRequestParameter('id'))) {
            $Presscenter = new Presscenter();
            
        }
        $this->__assign(array(
            'Presscenter' => $Presscenter,
        ));
        return $this->__display('openeddoors_one.tpl');
	}
	
}
?>